
import initMixin from './init'
import { initLifeCycle } from "./lifeCycle";
import { nextTick } from './observer/watcher'
import { initGlobalAPI } from "./globalAPI";
// import compilerToFunction from './compiler/index';
// import { createElement, patch } from './vDom/patch'

function Vue(options) {
    this._init(options)
}

initMixin(Vue)
initLifeCycle(Vue)
initGlobalAPI(Vue)
Vue.prototype.$nextTick = nextTick


//----------diff---------------

// let render1 = compilerToFunction(`<li id="a" style="color: pink" >

//     <div  key='1' >1</div>
//     <div  key='2' >2</div>
//     <div  key='6' >6</div>
//     </li>`)
// let vm1 = new Vue({ data: { name: 'zf' } })
// let preNode = render1.call(vm1)

// let el = createElement(preNode)
// document.body.appendChild(el)

// let render2 = compilerToFunction(`<li id='a' style='background:yellow;'>
// <div  key='3' >3</div>
// <div  key='4' >4</div>
// <div  key='1' >1</div>
// <div  key='2' >2</div>




// </li>`)
// let vm2 = new Vue({ data: { name: 'zf-new' } })
// let nextNode = render2.call(vm2)

// setTimeout(() => {
//     patch(preNode, nextNode)
// }, 3000)


export default Vue